export const getDataType = (data) => {
  const len = data.length
  const left = Math.ceil(len / 2)
  const leftData = data.slice(0, left)
  const isNewZ = leftData.every((item, idx) => {
    return (2 * idx + 1) === item.stationNo 
  })
  if (isNewZ) return 'newZ'
  const isNewB = leftData.every((item, idx) => {
    if (idx % 2 === 0) {
      return 4 * Math.ceil(idx / 2) + 1 === item.stationNo
    }
    return 4 * Math.ceil(idx / 2) === item.stationNo
  })
  if (isNewB) return 'newB'
  // 12435
  const isNewU = leftData.every((item, idx) => {
    return (idx + 1) === item.stationNo
  })
  let isOldZ = false
  if (isNewU) {
    isOldZ = data.every((item, idx) => {
      return idx + 1 === item.stationNo
    })
  }
  if (isNewU && !isOldZ) return 'newU'
  if (isNewU && isOldZ) return'oldZ'
  const isOldU = isOldZ = data.every((item, idx) => {
    if (idx % 2 === 0) {
      return (idx / 2) + 1 === item.stationNo
    }
    return true
  })
  if (isOldU) return 'oldU'
  if (!isNewZ && !isNewB && !isNewU && !isOldZ && !isOldU) {
    return 'oldB'
  }
  return 'oldZ'
}